package com.ivan.toolkit.common;

import lombok.Getter;
import lombok.Setter;

public class AnyResult {

	@Getter @Setter
	private boolean success = false;

	@Getter @Setter
	private String message = "";

	@Getter @Setter
	private Object data = null;
	
	public static AnyResult success() {
		return new AnyResult(true, "OK", null);
	}
	
	public static AnyResult failure() {
		return new AnyResult(false, "FAILED", null);
	}
	
	public AnyResult(boolean success, String message, Object data) {
		super();
		this.success = success;
		this.message = message;
		this.data = data;
	}


	public AnyResult() {
	}
	
	public AnyResult message(String message) {
		this.message = message;
		return this;
	}
	
	public AnyResult data(Object data) {
		this.data = data;
		return this;
	}
	
}
